import http from '../util/request.js';

export default {

    /*对商品的数据操作*/
    one:(id)=>{
        return http({
            url:'api/admin/'+id,
            method:'get'
        });
    },
    page:(params)=>{
        return http({
            url:'api/admin/page',
            method:'get',
            params:params
        });
    },
    all:(params)=>{
        return http({
            url:'api/admin',
            method:'get',
            params:params
        });
    },
    add:(obj)=>{
        return http({
            url:'api/admin',
            method:'post',
            data: obj,
            headers: {
                'Content-Type': 'application/json'
            }});
    },
    delete:(id)=>{
        return http({
            url:"api/admin/"+id,
            method:'delete'
        });
    },
    edit:(obj)=>{
        return http({
            url:"api/admin",
            method:'PUT',
            data: obj,
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },

}
